<template>
	<view class="totalIncome">
		<!-- 收益列表部分 -->
		<view v-for="(item, index) in moneyList" :key="index" class="income-item">
			<view class="income-info">
				<u-icon name="rmb-circle-fill" size="12" color="#f8c22c"></u-icon>
				<text class="income-label" style="margin-left: 6rpx;">未结算</text>
				<text class="income-time">{{ item.incomeTime }}</text>
			</view>
			<view class="income-detail">
				<text class="income-amount">+{{ item.thisIncome }}</text>
				<text class="income-order">订单编号{{ item.orderNumber }}</text>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data(){
			return{
				totalIncomeNum:0,
				totalIncomeNum:0,
			}
		},
		props: {
			moneyList: {
				type: Array,
				default: () => []
			}
		},
		computed: {
			totalIncome() {
				return this.moneyList.reduce((acc, cur) => acc + cur.thisIncome, 0);
			}
		},
		methods: {
			showMoreDetails() {
				// 处理点击更多明细的逻辑
			}
		}
	};
</script>

<style scoped>
	.totalIncome {
		width: 90%;
		margin: auto;
	}

	/* #ifdef H5 */
	.totalIncome {
		width: 90%;
		margin: auto;
	}
	.income-item {
		width: 100%;
	}
	/* #endif */
	.income-label {
		font-size: 16px;
		font-weight: bold;
	}

	.income-item {
		display: flex;
		flex-direction: column;
		background-color: white;
		width: 90%;
		border-radius: 30rpx;
		margin: 30rpx 0;
		padding: 30rpx;
		height: 200rpx;
		display: flex;
		flex-direction: column;
		/* 设置主轴为垂直方向 */
		justify-content: space-between;
		/* 在主轴上均匀分布子元素，第一个在顶部，最后一个在底部 */
	}

	.income-info {
		display: flex;
		align-items: center;
		justify-content: space-between;
	}

	.income-time {
		margin-left: auto;
		color: #c5c5c5;
		font-size: 24rpx;
	}

	.income-detail {
		display: flex;
		align-items: center;
		justify-content: space-between;
		margin-top: 5px;
	}

	.income-amount {
		font-weight: bold;
	}

	.income-order {
		margin-left: auto;
		color: #c5c5c5;
		font-size: 24rpx;
	}
</style>